package com.chou.sts.domain;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.xml.bind.annotation.XmlRootElement;

import com.thoughtworks.xstream.annotations.XStreamAlias;

//@XStreamAlias("student")
@XmlRootElement(name="student")
@Entity
public class Student 
{
	@Id
	private Integer id;
	private String firstName;
	private String lastName;
	private String address;
	private String phone;
	private String email;
	private String parentFirstName;
	private String parentLastName;
	@OneToMany(targetEntity=LevelHistory.class, fetch=FetchType.EAGER)
	private List<LevelHistory> levelHistories;
	
	public Integer getId() 
	{
		return id;
	}
	
	public void setId(Integer id) 
	{
		this.id = id;
	}
	
	public String getFirstName() 
	{
		return firstName;
	}
	
	public void setFirstName(String firstName) 
	{
		
		this.firstName = firstName;
	}
	
	public String getLastName() 
	{
		return lastName;
	}
	
	public void setLastName(String lastName) 
	{
		this.lastName = lastName;
	}
	
	public String getAddress() {
		return address;
	}
	
	public void setAddress(String address) 
	{
		this.address = address;
	}
	
	public String getPhone() 
	{
		return phone;
	}
	
	public void setPhone(String phone) 
	{
		this.phone = phone;
	}
	
	public String getEmail() 
	{
		return email;
	}
	
	public void setEmail(String email) 
	{
		this.email = email;
	}
	
	public String getParentFirstName() 
	{
		return parentFirstName;
	}
	
	public void setParentFirstName(String parentFirstName) 
	{
		this.parentFirstName = parentFirstName;
	}
	
	public String getParentLastName() 
	{
		return parentLastName;
	}
	
	public void setParentLastName(String parentLastName) 
	{
		this.parentLastName = parentLastName;
	}

	public List<LevelHistory> getLevelHistories() 
	{
		return levelHistories;
	}

	public void setLevelHistories(List<LevelHistory> levelHistories) 
	{
		this.levelHistories = levelHistories;
	}
	
	@Override
	public String toString() 
	{
		return "Student [id=" + id + ", firstName=" + firstName + ", lastName="
				+ lastName + ", address=" + address + ", phone=" + phone
				+ ", email=" + email + ", parentFirstName=" + parentFirstName
				+ ", parentLastName=" + parentLastName + "]";
	}	
}
